//
//  SecondViewController.swift
//  SwiftDemo
//
//  Created by hfzhangzhang on 2018/7/11.
//  Copyright © 2018年 hfzhangzhang. All rights reserved.
//

import UIKit

class SecondViewController: UIViewController {
    
    let coreBtnDemo:UIButton = {
        let coreBtnDemo = UIButton.init(type: UIButtonType.custom)
        coreBtnDemo.frame = CGRect(x: 10, y: 10, width: 100, height: 50)
        coreBtnDemo.backgroundColor = UIColor.blue;
        coreBtnDemo.setTitle("CoreData", for: UIControlState.normal)
        coreBtnDemo.addTarget(self, action:#selector(CoreDataDemo) , for: UIControlEvents.touchUpInside)
        return coreBtnDemo;
    }()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        self.view.addSubview(coreBtnDemo)
    }
    @objc func CoreDataDemo(){
        self.navigationController?.pushViewController(CoreDataViewController(), animated: true);
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
       
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
